$(document).ready(function(){
    $('#li2').hover(function(){//.................导航产品介绍的 字菜单 显示与隐藏...............
        $('#headerUl').slideDown(200);
    },function(){
        $('#headerUl').slideUp(200);
    })
});
function bannerImg(now){
    $(".banner-ul li").eq(now).fadeIn(500).siblings().fadeOut(500);
    $("#olActive li").eq(now).addClass('active').siblings().removeClass('active');
}
$(function() {
    // banner
    var now = 0;
    $("#olActive li").click(function () {
        var index = $("#olActive li").index(this);
        bannerImg(index);
        now = index;
    });
    $("#next").click(function(){
        now++;
        if(now == 3){
            now = 0;
        }
        bannerImg(now);
    });
    setInterval(function(){
        $("#next").click();
    },3000);

        /*................................服务项目.................................................*/
        var moves = document.getElementsByClassName('moves');
        var oDiv1 = document.getElementsByClassName('div1');
        for(var k=0;k<oDiv1.length;k++){
            //alert(oDiv1.length);
            oDiv1[k].index=k;
            oDiv1[k].onmouseover=function(){
                for(var i=0;i<moves.length;i++){
                    moves[i].index=i;
                    starMove(moves[this.index],{left:210,top:-140});
                }
            };
            oDiv1[k].onmouseout=function(){
                for(var i=0;i<moves.length;i++){
                    moves[i].index=i;
                    starMove(moves[this.index],{left:0,top:0});
                }
            }
        }
        /*................................智慧解决方案.................................................*/
        var imgDiv = document.getElementsByClassName('imgDiv');
        var img1 = document.getElementsByClassName('img1');
        for(var j=0;j<imgDiv.length;j++){
            //alert(imgDiv.length);
            imgDiv[j].index=j;
            imgDiv[j].onmouseover=function(){
                for(var i=0;i<img1.length;i++){
                    img1[i].index=i;
                    starMove(img1[this.index],{top:188});
                }
            };
            imgDiv[j].onmouseout=function(){
                for(var i=0;i<img1.length;i++){
                    img1[i].index=i;
                    starMove(img1[this.index],{top:0});
                }
            }

        }
        /*................................客户合作.................................................*/
        var oUl1 = document.getElementById('ul1');
        var oUl2 = document.getElementById('ul2');
        var oUl2_li = oUl2.getElementsByTagName('li');
        for(var i=0;i<oUl2_li.length;i++){
            //alert(oUl2_li.length);
            oUl2_li[i].index=i;
            oUl2_li[i].onmouseover=function(){
                //alert(this.index);
                var now=this.index;
                starMove(oUl1,{left:-292*now});
            }
        }
});
